package com.newtouch.avmarketing.mgr.modules.avmarkrting.repo;

import com.newtouch.avmarketing.mgr.modules.avmarkrting.entity.MeetIngInfo;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

@Repository
public interface MeetIngRepo extends JpaRepository<MeetIngInfo,Long>
        , JpaSpecificationExecutor<MeetIngInfo> {

    /**
     * 查询会议记录生成24小时之内的数据
     * @param oprator_no
     * @param pageable
     * @return
     */
    @Query(value = "select * from t_meeting_info t where t.originator_no = :opNo and date_add(t.create_time, interval 1 day) >= now() order by t.update_time desc" ,nativeQuery = true)
    public Page<List<MeetIngInfo>> findMeetIngListByOpNo(@Param("opNo")String oprator_no, Pageable pageable);
}
